<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*"%>
<%@page import="model.News"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %><%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- includes -->
<%@ include file="../includes/includes.jsp"%>
<!-- fin includes -->
<script type=”text/javascript”
	src=”http://code.jquery.com/jquery-latest.js”></script>

<script type="text/javascript">
	function cambia() {
		alert("cambia");
		$("h4").css("background-color", "red");

	}
</script>
<title>JSPBlog search ....</title>
</head>
<body>

<!-- cabecera -->
<%@ include file="../includes/header.jsp"%>
<!-- fin cabecera -->
<div id="main">
<div class="article">
<table height="136" border="0" cellpadding="0" cellspacing="0">
	<tbody>
		<tr>
			<td class="menu" valign="top"><a href="#TOP"></a> <!-- contenido central -->
<%
// add_res.jsp // form data
//String user = request.getParameter("user");
String strId =  request.getParameter("q");
int id = Integer.parseInt(strId);
String tittle = request.getParameter("tittle");
String date = request.getParameter("date");
//String body = request.getParameter("body");
String body = request.getParameter("EditorDefault");
String about = request.getParameter("about");
String category = request.getParameter("category");
String author = request.getParameter("author"); 

%>
<%= "Body " + body %>
<br>
<%= "Titulo " + tittle %>
</center>
<%
  boolean resultado = false;
    News n = new News();
    
    try
    {
    resultado = n.updateNews(id , body);
    }
    catch(Exception e){
    	e.printStackTrace();
    }
    
    	//n.addNews(tittle,body ,date , author , 0);
    
    if (resultado) {
        out.println("Entry succesfully modified.");
        out.println("<br><br><a href='addnews.jsp'>Add Another blog</a> | <a href='../index.jsp'>Home</a>");
    } else {
        out.println("Error! Please try again.");
    }

    %>	<!-- fin contenido central --></td>
		</tr>
	</tbody>
</table>

</div>
</div>


<!-- menu  -->
<%@ include file="../includes/menu.jsp"%>
<!--  fin menu  -->

<!-- footer  -->
<%@ include file="../includes/footer.jsp"%>
<!--  fin footer -->

</body>
</html>
